<include file="Public:header" />
<script type="text/javascript" src="/Public/step-jquery-dc/step-jquery-dc.js"></script>
<link rel="stylesheet" href="/Public/step-jquery-dc/css/step-dc-style1.css" />

<link rel="stylesheet" type="text/css" href="__PUBLIC__/poshytip/tip-yellow/tip-yellow.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/poshytip/tip-yellowsimple/tip-yellowsimple.css" />
<script type="text/javascript" src="__PUBLIC__/poshytip/jquery.poshytip.min.js"></script>

<script type="text/javascript" src="__PUBLIC__/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/ToolTip.js"></script>


<style type="text/css">
.bg-color{ background-color: #92D050; color: #FF0000;  }
.hide { display: none; }
.sign_class th{ color: blue }

/* .step_context li { width: 165px; } */

</style>
<form name="myform" id="myform" method="POST" action=""  enctype="multipart/form-data">
	<input name="id" id="client_id" type="hidden" value="{$info['id']}">

  <fieldset>
    <legend>个人信息</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody style="" >
        <tr style="height:32px; overflow: hidden; ">
          <th width="120">姓名：</th>
          <td >
            <input type="text" name="data[name]" id="name" size="20"  value="{$info.name}" class="input-text"  />
          </td>
        </tr>
        <tr>
          <th width="120">性别：</th>
          <td>
            <label><input name="sex" type="radio" value="1" checked="checked" >&nbsp;男&nbsp;&nbsp;</label>
            <label><input name="sex" type="radio" value="0" <eq name="info.sex" value="0"> checked </eq> >&nbsp;女</label>
            <span style="margin-left:135px;">民族：</span>
            <input type="text" name="data[race]" id="race" size="20"  value="{$info.race|default='汉'}" class="input-text" style="width:105px;"  />

          </td>
        </tr>


        <tr class="sign_class" style="display:none;">
          <th>身份证号码：</th>
          <td>
            <input type="text" name="data[idcard]" id="idcard" value="{$info.idcard}" class="input-text" style="width:125px;" />

            <span style="margin-left:20px; color: blue; ">护照号：</span>
            <input type="text" name="data[passport]" id="passport" value="{$info.passport}" class="input-text"  />
          </td>
        </tr>
        <tr class="last">
          <th>所在地：</th>
          <td>
            <input type="text" name="data[address]" id="address" value="{$info.address}" class="input-text" style="width:125px;" />
          </td>
        </tr>
      </tbody>
    </table>
  </fieldset>
  <fieldset>
    <legend>联系方式</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody>
        <tr>
          <th width="120">QQ：</th>
          <td>
            <input type="text" name="data[qq]" id="qq" size="20"  value="{$info.qq}" class="input-text" style="width:120px;" />
            <span style="margin-left:20px;">国内手机：</span>
            <input type="text" name="data[phone]" id="phone" size="20"  value="{$info.phone}" class="input-text" style="width:120px;" />
          </td>
        </tr>
        <tr class="last">
          <th width="120">微信：</th>
          <td>
            <input type="text" name="data[wechat]" id="wechat" size="20"  value="{$info.wechat}" class="input-text" style="width:120px;" />
            <span style="margin-left:20px; display:none;"  class="sign_class" >韩国手机：</span>
            <input type="text" name="data[phone_korea]" id="phone_korea" size="20"  value="{$info.phone_korea}" class="input-text sign_class" style="width:120px; display:none;" />

          </td>
        </tr>
      </tbody>
    </table>
  </fieldset>
  <fieldset class="sign_class"  >
    <legend>基本信息</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody>
        <tr >
          <th width="120">课程项目：</th>
          <td>
            <select name="data[course]" id="course" style="width: 133px;">
              <option value="0">请选择课程项目</option>
              <volist name=":get_course_list()" id="vo">
                <option value="{$vo.id}" {:selected($vo['id'],$info['course'])} >{$vo.name}</option>
              </volist>
            </select>

            <span style="margin-left:20px;"  class="sign_class" >课程详细：</span>
            <input type="text" name="data[course_text]" id="course_text" size="20"  value="{$info.course_text}" class="input-text sign_class" style="width:220px;" />
          </td>
        </tr>
        <tr >
          <th width="120">意向级别：</th>
          <td>
            <select name="data[level]" id="level" style="width: 133px;">
              <option value="0">请选择级别</option>
              <volist name=":get_level_list()" id="vo">
                <option value="{$vo.id}" {:selected($vo['id'],$info['source'])}>{$vo.name}</option>
              </volist>
            </select>

            <span style="margin-left:20px; "  class="sign_class" >级别详细：</span>
            <select name="data[level_text]" id="level_text" style="width: 133px;">
              <option value="0">请选择级别</option>
              <volist name=":get_rank_list()" id="vo">
                <option value="{$vo.id}" {:selected($vo['id'],$info['source'])}>{$vo.name}</option>
              </volist>
            </select>
          </td>
        </tr>
        <tr >
          <th width="120">咨询方式：</th>
          <td>
            <select name="data[source]" id="source" style="width: 133px;">
              <option value="0">请选择咨询方式</option>
              <volist name=":get_source_list()" id="vo">
                <option value="{$vo.id}" {:selected($vo['id'],$info['source'])}>{$vo.name}</option>
              </volist>
            </select>

            <span style="margin-left:20px;">合作伙伴：</span>
            <select name="data[partner]" id="partner" style="width: 133px;">
              <option value="0">请选择合作伙伴</option>
              <volist name=":get_partner_list()" id="vo">
                <option value="{$vo.id}" {:selected($vo['id'],$info['partner'])}>{$vo.name}</option>
              </volist>
            </select>
          </td>
        </tr>

        <tr >
          <th width="120">合作人：</th>
          <td>
            <input type="text" name="data[partner]" id="partner" size="20"  value="{$info.partner}" class="input-text" />
          </td>
        </tr>

        <tr class="last">
          <th width="120">上次跟进时间：</th>
          <td>
            <input type="text" name="talk_time" id="talk_time" size="20"  value="{$info.talk_time|mydate2}" class="input-text Wdate" readonly="" />

            <span style="margin-left:20px;">下次根进时间：</span>
            <input type="text" name="talk_time2" id="talk_time2" size="20"  value="{$info.talk_time2|mydate}"  class="input-text Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" style=""/>

          </td>
        </tr>


      </tbody>
    </table>
  </fieldset>
  <fieldset style="display: none;">
    <legend>处理进度</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody>
        <tr>
          <th width="120">处理状态：</th>
          <td>
            <label><input name="data[sign_status]" class="sign_status" type="radio" value="0" checked="checked" >&nbsp;正在洽谈</label>
          <label><input name="data[sign_status]" class="sign_status" type="radio" value="1"  <eq name="info.sign_status" value="1"  > checked </eq>  >&nbsp;<span style="color:blue;">已经签约</span>&nbsp;&nbsp;</label>
          </td>
        </tr>

        <tr  class="last">
          <th width="120">跟踪处理：</th>
          <td>
            <input type="hidden" name="data[process]" id="process" value="{$info.process}">
            <input type="hidden" id="process0" value="{$info.process}">
            <div class="step_context current_status" style="height:100px;"></div>
          </td>
        </tr>
      </tbody>
    </table>
  </fieldset>




  <input type="submit" value="提交" class="dialog" id="dosubmit">
</form>
</body>
</html>

<script type="text/javascript">
$(function() {

    $('#myform').ajaxForm({
        beforeSubmit: checkForm,
        success: complete,
        dataType: 'json'
    });

    function checkForm() {
        var name = $("#name").val();
        var phone = $("#phone").val();
        var content = $("#content").val();
        if (name == '') {
            msg('联系人不能为空！', 0);
            $('#name').focus();
            return false;
        }
        if (phone == '') {
            msg('电话号码不能为空！', 0);
            $('#phone').focus();
            return false;
        }
        return true;
    }
    var origin = $.artDialog.open.origin;

    function complete(data) {
        msg(data.info, data.status);
        if (data.status) setTimeout(function() {
            origin.location.reload();
        }, 1000);
    }
})
</script>
<script type="text/javascript">
$(function() {
    $('#province').live('change', function() {
        var pid = $(this).val();
        $("#city").empty();
        $("#area").empty();
        $("#area").append('<option value="0">请选择区域</option>');
        jQuery.ajax({
            type:'GET',
            url:"{:U('area/ajax_city_option')}",
            data:encodeURI('pid='+pid),
            dataType:'json',
            success:function(data){
              $("#city").append(data.option);
            }
        });
    });

    $('#city').live('change', function() {
        var cid = $(this).val();
        $("#area").empty();
        jQuery.ajax({
            type:'GET',
            url:"{:U('area/ajax_area_option')}",
            dataType: 'json',
            data: encodeURI('cid=' + cid),
            success: function(data) {
                $("#area").append(data.option);
            }
        });
    });
})
</script>

<script type="text/javascript">
//所有步骤的数据
var stepListJson=[{StepNum:1,StepText:"新来电"},
{StepNum:2,StepText:"了解意向"},
{StepNum:3,StepText:"推荐"},
{StepNum:4,StepText:"邀约"},
{StepNum:5,StepText:"邀约成功"},
{StepNum:6,StepText:"邀约成功"},
{StepNum:7,StepText:"邀约成功"},
{StepNum:8,StepText:"成交"}];
//var stepListJson = {$stepListJson};
var allNum = stepListJson.length;
//当前进行到第几步
var currentStep={$info['process']|default='1'};
//new一个工具类
var StepTool = new Step_Tool_dc("current_status","mycall");
//使用工具对页面绘制相关流程步骤图形显示
StepTool.drawStep(currentStep,stepListJson);
//回调函数
function mycall(restult){
//  alert("mycall"+result.value+":"+result.text);
  if(allNum==result.value){
    $(".sign_status:eq(1)").attr("checked",'checked');
    sign_action();
  }else{
    $(".sign_status:eq(0)").attr("checked",'checked');
    sign_action();
  }
  /*if(result.value<currentStep){
    alert('客户进度只能前进不能后退！');
    return false;
  }*/
  StepTool.drawStep(result.value,stepListJson);
  $("#process").val(result.value);
}
</script>